// 添加日期范围
export function addDateRange(query, dateRange) {
  const search = query
  search.map = {}
  dateRange = Array.isArray(dateRange) ? dateRange : []
  if (dateRange.length !== 2) {
    delete search.map
  } else {
    search.map['begin'] = dateRange[0]
    search.map['end'] = dateRange[1]
  }
  return search
}
